/**
 * 
 */
package com.hs.auth.dao.impl;

import java.util.Map;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.hs.auth.dao.IOrgDao;
import com.hs.core.dao.impl.BaseDao;
import com.hs.core.utils.PageParam;
import com.hs.core.utils.PageQuery;
import com.hs.core.utils.PageUtil;

/**
 * @author shl
 *
 * Dec 9, 2010
 */
@Repository 
public class OrgDao extends BaseDao implements IOrgDao{
	 
	public PageUtil getOrgList(PageParam pageParam){
		PageQuery pq = new PageQuery(pageParam);
		Query query = null;
		query = this.getSession().createQuery(pageParam.getSearchSql());
		
		/*Map map =pageParam.getConditionMap(); 
		int i = 0;
		if(map.containsKey("orgname"))
		{     
			query.setParameter(i++, "%"+(String)map.get("orgname")+"%");
			System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+++++++++++++++++++"+"%"+(String)map.get("orgname")+"%");
		} */
		 
		PageUtil pu = pq.getPageUtil(query,this.getSession());
		return pu;
	}
}
